// 麻将常量

// 定义麻将花色和牌值的枚举
export enum Suit {
    WAN = '万',
    BING = '饼',
    TIAO = '条',
    DONG = '东',
    NAN = '南',
    XI = '西',
    BEI = '北',
    ZHONG = '中',
    FA = '发',
    BAI = '白',
    CHUN = '春',
    XIA = '夏',
    QIU = '秋',
    DONG1 = '冬',
    MEI = '梅',
    LAN = '兰',
    ZHU = '竹',
    JU = '菊',
}

/** 美术定义值 */
export const suitValue: Map<string, number> = new Map([
    ['万', 1], ['饼', 2], ['条', 3],
    ['东', 4], ['南', 4], ['西', 4], ['北', 4],
    ['中', 5], ['发', 5], ['白', 5],
    ['梅', 6], ['兰', 6], ['竹', 6], ['菊', 6],
    ['春', 7], ['夏', 7], ['秋', 7], ['冬', 7],
])

/** 其他花色牌 */
export const otherSuit: string[][] = [
    ['东', '南', '西', '北'],
    ['中', '发', '白'],
    ['春', '夏', '秋', '冬'],
    ['梅', '兰', '竹', '菊']
]

// 消除分数定义
export const scoreTable: Record<string, number> = {
    // 万、饼、条
    '万': 10, '饼': 20, '条': 30,
    // 字牌
    '东': 40, '南': 40, '西': 40, '北': 40, '中': 50, '发': 50, '白': 50,
    // 花牌
    '春': 60, '夏': 60, '秋': 60, '冬': 70, '梅': 80, '兰': 80, '竹': 80, '菊': 80
};

// 定义麻将牌的数据结构
export interface MahjongTile {
    suit: Suit;
    value: number;
}

/** 第一层 */
export const cardList1: number[][] = [
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
]

/** 第二层 */
export const cardList2: number[][] = [
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
    [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
    [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]

/** 第三层 */
export const cardList3: number[][] = [
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]

/** 第四层 */
export const cardList4: number[][] = [
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]

/** 第五层 */
export const cardList5: number[] = [5.5, 3.5]

/** 第一层其他 */
export const otherCardList1: number[][] = [
    [-1, 3.5],
    [12, 3.5],
    [13, 3.5],
]
